const vendor = require('./common/vendor');
const { dayjs } = require('./common/lib');
const { defineStore, createSSRApp, createPinia } = vendor;
let store = createPinia();
let app = createSSRApp();
app.use(store);

const useCounterStore = defineStore('counter', {
    state: () => ({ count: 0, name: 'Eduardo' }),
    getters: {
        doubleCount: (state) => state.count * 2,
    },
    actions: {
        increment() {
            this.count++
        },
    },
});




App({
    globalData: {
        useCounterStore
    },
    onLaunch() {
        let now = dayjs()
        console.log('launch now', now);
    }
})
